package com.example.dml.adapter_pattern;

/**
 * @Authors：gaoyang
 * @CreateTime：2021/10/29 23:55
 * @Description：电源适配器类
 */
public class PowerAdapter implements DC5{

    private AC220 ac220;

    public PowerAdapter(AC220 ac220) {
        this.ac220 = ac220;
    }

    @Override
    public int outputDC5() {
        int adapterInput = ac220.outputAC220V();
        //变压
        int adapterOutput = adapterInput/44;
        System.out.println("使用PowerAdapter输入AC"+adapterInput+"V"+"，输出"+adapterOutput+"V");
        return adapterOutput;
    }
}
